home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / zip.h < prev    next >
C/C++ Source or Header  |  1998-09-15  |  2KB  |  65 lines

  1. /*
  2.  * @(#)zip.h    1.4 97/01/24
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. /*
  24.  * Prototypes for "zip" file reader support
  25.  */
  26.  
  27. #ifndef _ZIP_H_
  28. #define _ZIP_H_
  29.  
  30. #include <time.h>
  31. #include "bool.h"
  32.  
  33. /*
  34.  * Central directory entry
  35.  */
  36. typedef struct {
  37.     char *fn;        /* file name */
  38.     int len;        /* file size */
  39.     int size;        /* file compressed size */
  40.     int method;        /* Compression method */
  41.     int mod;        /* file modification time */
  42.     long off;        /* local file header offset */
  43. } direl_t;
  44.  
  45. /*
  46.  * Zip file
  47.  */
  48. typedef struct {
  49.     char *fn;        /* zip file name */
  50.     int fd;        /* zip file descriptor */
  51.     direl_t *dir;    /* zip file directory */
  52.     int nel;        /* number of directory entries */
  53.     long cenoff;    /* Offset of central directory (CEN) */
  54.     long endoff;    /* Offset of end-of-central-directory record */
  55. } zip_t;
  56.  
  57. struct stat;
  58.  
  59. zip_t *zip_open(const char *fn);
  60. void zip_close(zip_t *zip);
  61. bool_t zip_stat(zip_t *zip, const char *fn, struct stat *sbuf);
  62. bool_t zip_get(zip_t *zip, const char *fn, void *buf, int len);
  63.  
  64. #endif /* !_ZIP_H_ */ 
  65.